package com.newly.center.business.api;

import com.newly.api.business.feign.MQTTSerialClient;
import com.newly.center.business.service.MQTTSerialService;
import com.newly.common.base.constants.ServerUriConstant;
import com.newly.common.base.entity.R;
import com.newly.common.base.entity.business.Vo.SerialVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(ServerUriConstant.NEWLY_BUSINESS_MQTT_Serial)
public class MQTTSerialController implements MQTTSerialClient {

    @Autowired
    MQTTSerialService MQTTSerialService;

    @Override
    public R getSerials(String productKey) {
        return MQTTSerialService.getSerials(productKey);
    }

    @Override
    public R getSerial(String productKey,int index) {
        return MQTTSerialService.getSerial(productKey,index);
    }

    @Override
    public R setSerial(SerialVo serialVo) {
        return MQTTSerialService.setSerial(serialVo);
    }

}
